Optimal. Leaf size=420 \[ \frac {\tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right ) \left (48 c^2 \left (a^2 f h^2+2 a b h (e h+2 f g)+b^2 \left (d h^2+2 e g h+f g^2\right )\right )-40 b^2 c h (3 a f h+b e h+2 b f g)-64 c^3 \left (a \left (d h^2+2 e g h+f g^2\right )+b g (2 d h+e g)\right )+35 b^4 f h^2+128 c^4 d g^2\right )}{128 c^{9/2}}-\frac {\sqrt {a+b x+c x^2} \left (-2 c h x \left (-4 c h (9 a f h+10 b e h+6 b f g)+35 b^2 f h^2-8 c^2 \left (f g^2-2 h (3 d h+2 e g)\right )\right )+8 c^2 h \left (16 a h (e h+2 f g)+b \left (18 h (d h+2 e g)+11 f g^2\right )\right )-20 b c h^2 (11 a f h+6 b (e h+2 f g))+105 b^3 f h^3+32 c^3 g \left (f g^2-4 h (3 d h+e g)\right )\right )}{192 c^4 h}-\frac {(g+h x)^2 \sqrt {a+b x+c x^2} (7 b f h-8 c e h+2 c f g)}{24 c^2 h}+\frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 1.01, antiderivative size = 418, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.156, Rules used = {1653, 832, 779, 621, 206} \[ \frac {\tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right ) \left (48 c^2 \left (a^2 f h^2+2 a b h (e h+2 f g)+b^2 \left (h (d h+2 e g)+f g^2\right )\right )-40 b^2 c h (3 a f h+b e h+2 b f g)-64 c^3 \left (a h (d h+2 e g)+a f g^2+b g (2 d h+e g)\right )+35 b^4 f h^2+128 c^4 d g^2\right )}{128 c^{9/2}}-\frac {\sqrt {a+b x+c x^2} \left (-2 c h x \left (-4 c h (9 a f h+10 b e h+6 b f g)+35 b^2 f h^2-8 c^2 \left (f g^2-2 h (3 d h+2 e g)\right )\right )+8 c^2 h \left (16 a h (e h+2 f g)+18 b h (d h+2 e g)+11 b f g^2\right )-20 b c h^2 (11 a f h+6 b (e h+2 f g))+105 b^3 f h^3+32 c^3 \left (f g^3-4 g h (3 d h+e g)\right )\right )}{192 c^4 h}-\frac {(g+h x)^2 \sqrt {a+b x+c x^2} (7 b f h-8 c e h+2 c f g)}{24 c^2 h}+\frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 621
Rule 779
Rule 832
Rule 1653
Rubi steps
\begin {align*} \int \frac {(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt {a+b x+c x^2}} \, dx &=\frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}+\frac {\int \frac {(g+h x)^2 \left (-\frac {1}{2} h (b f g-8 c d h+6 a f h)-\frac {1}{2} h (2 c f g-8 c e h+7 b f h) x\right )}{\sqrt {a+b x+c x^2}} \, dx}{4 c h^2}\\ &=-\frac {(2 c f g-8 c e h+7 b f h) (g+h x)^2 \sqrt {a+b x+c x^2}}{24 c^2 h}+\frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}+\frac {\int \frac {(g+h x) \left (\frac {1}{4} h \left (7 b^2 f g h+28 a b f h^2-4 b c g (f g+2 e h)+4 c h (12 c d g-7 a f g-8 a e h)\right )+\frac {1}{4} h \left (35 b^2 f h^2-4 c h (6 b f g+10 b e h+9 a f h)-8 c^2 \left (f g^2-2 h (2 e g+3 d h)\right )\right ) x\right )}{\sqrt {a+b x+c x^2}} \, dx}{12 c^2 h^2}\\ &=-\frac {(2 c f g-8 c e h+7 b f h) (g+h x)^2 \sqrt {a+b x+c x^2}}{24 c^2 h}+\frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}-\frac {\left (105 b^3 f h^3+32 c^3 \left (f g^3-4 g h (e g+3 d h)\right )-20 b c h^2 (11 a f h+6 b (2 f g+e h))+8 c^2 h \left (11 b f g^2+18 b h (2 e g+d h)+16 a h (2 f g+e h)\right )-2 c h \left (35 b^2 f h^2-4 c h (6 b f g+10 b e h+9 a f h)-8 c^2 \left (f g^2-2 h (2 e g+3 d h)\right )\right ) x\right ) \sqrt {a+b x+c x^2}}{192 c^4 h}+\frac {\left (128 c^4 d g^2+35 b^4 f h^2-40 b^2 c h (2 b f g+b e h+3 a f h)-64 c^3 \left (a f g^2+a h (2 e g+d h)+b g (e g+2 d h)\right )+48 c^2 \left (a^2 f h^2+2 a b h (2 f g+e h)+b^2 \left (f g^2+h (2 e g+d h)\right )\right )\right ) \int \frac {1}{\sqrt {a+b x+c x^2}} \, dx}{128 c^4}\\ &=-\frac {(2 c f g-8 c e h+7 b f h) (g+h x)^2 \sqrt {a+b x+c x^2}}{24 c^2 h}+\frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}-\frac {\left (105 b^3 f h^3+32 c^3 \left (f g^3-4 g h (e g+3 d h)\right )-20 b c h^2 (11 a f h+6 b (2 f g+e h))+8 c^2 h \left (11 b f g^2+18 b h (2 e g+d h)+16 a h (2 f g+e h)\right )-2 c h \left (35 b^2 f h^2-4 c h (6 b f g+10 b e h+9 a f h)-8 c^2 \left (f g^2-2 h (2 e g+3 d h)\right )\right ) x\right ) \sqrt {a+b x+c x^2}}{192 c^4 h}+\frac {\left (128 c^4 d g^2+35 b^4 f h^2-40 b^2 c h (2 b f g+b e h+3 a f h)-64 c^3 \left (a f g^2+a h (2 e g+d h)+b g (e g+2 d h)\right )+48 c^2 \left (a^2 f h^2+2 a b h (2 f g+e h)+b^2 \left (f g^2+h (2 e g+d h)\right )\right )\right ) \operatorname {Subst}\left (\int \frac {1}{4 c-x^2} \, dx,x,\frac {b+2 c x}{\sqrt {a+b x+c x^2}}\right )}{64 c^4}\\ &=-\frac {(2 c f g-8 c e h+7 b f h) (g+h x)^2 \sqrt {a+b x+c x^2}}{24 c^2 h}+\frac {f (g+h x)^3 \sqrt {a+b x+c x^2}}{4 c h}-\frac {\left (105 b^3 f h^3+32 c^3 \left (f g^3-4 g h (e g+3 d h)\right )-20 b c h^2 (11 a f h+6 b (2 f g+e h))+8 c^2 h \left (11 b f g^2+18 b h (2 e g+d h)+16 a h (2 f g+e h)\right )-2 c h \left (35 b^2 f h^2-4 c h (6 b f g+10 b e h+9 a f h)-8 c^2 \left (f g^2-2 h (2 e g+3 d h)\right )\right ) x\right ) \sqrt {a+b x+c x^2}}{192 c^4 h}+\frac {\left (128 c^4 d g^2+35 b^4 f h^2-40 b^2 c h (2 b f g+b e h+3 a f h)-64 c^3 \left (a f g^2+a h (2 e g+d h)+b g (e g+2 d h)\right )+48 c^2 \left (a^2 f h^2+2 a b h (2 f g+e h)+b^2 \left (f g^2+h (2 e g+d h)\right )\right )\right ) \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+b x+c x^2}}\right )}{128 c^{9/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.65, size = 343, normalized size = 0.82 \[ \frac {3 \tanh ^{-1}\left (\frac {b+2 c x}{2 \sqrt {c} \sqrt {a+x (b+c x)}}\right ) \left (48 c^2 \left (a^2 f h^2+2 a b h (e h+2 f g)+b^2 \left (h (d h+2 e g)+f g^2\right )\right )-40 b^2 c h (3 a f h+b e h+2 b f g)-64 c^3 \left (a h (d h+2 e g)+a f g^2+b g (2 d h+e g)\right )+35 b^4 f h^2+128 c^4 d g^2\right )+2 \sqrt {c} \sqrt {a+x (b+c x)} \left (-8 c^2 \left (a h (16 e h+32 f g+9 f h x)+2 b h (9 d h+18 e g+5 e h x)+b f \left (18 g^2+20 g h x+7 h^2 x^2\right )\right )+10 b c h (22 a f h+b (12 e h+24 f g+7 f h x))-105 b^3 f h^2+16 c^3 \left (6 d h (4 g+h x)+4 e \left (3 g^2+3 g h x+h^2 x^2\right )+f x \left (6 g^2+8 g h x+3 h^2 x^2\right )\right )\right )}{384 c^{9/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.33, size = 861, normalized size = 2.05 \[ \left [\frac {3 \, {\left (16 \, {\left (8 \, c^{4} d - 4 \, b c^{3} e + {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} f\right )} g^{2} - 16 \, {\left (8 \, b c^{3} d - 2 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} e + {\left (5 \, b^{3} c - 12 \, a b c^{2}\right )} f\right )} g h + {\left (16 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} d - 8 \, {\left (5 \, b^{3} c - 12 \, a b c^{2}\right )} e + {\left (35 \, b^{4} - 120 \, a b^{2} c + 48 \, a^{2} c^{2}\right )} f\right )} h^{2}\right )} \sqrt {c} \log \left (-8 \, c^{2} x^{2} - 8 \, b c x - b^{2} - 4 \, \sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {c} - 4 \, a c\right ) + 4 \, {\left (48 \, c^{4} f h^{2} x^{3} + 48 \, {\left (4 \, c^{4} e - 3 \, b c^{3} f\right )} g^{2} + 16 \, {\left (24 \, c^{4} d - 18 \, b c^{3} e + {\left (15 \, b^{2} c^{2} - 16 \, a c^{3}\right )} f\right )} g h - {\left (144 \, b c^{3} d - 8 \, {\left (15 \, b^{2} c^{2} - 16 \, a c^{3}\right )} e + 5 \, {\left (21 \, b^{3} c - 44 \, a b c^{2}\right )} f\right )} h^{2} + 8 \, {\left (16 \, c^{4} f g h + {\left (8 \, c^{4} e - 7 \, b c^{3} f\right )} h^{2}\right )} x^{2} + 2 \, {\left (48 \, c^{4} f g^{2} + 16 \, {\left (6 \, c^{4} e - 5 \, b c^{3} f\right )} g h + {\left (48 \, c^{4} d - 40 \, b c^{3} e + {\left (35 \, b^{2} c^{2} - 36 \, a c^{3}\right )} f\right )} h^{2}\right )} x\right )} \sqrt {c x^{2} + b x + a}}{768 \, c^{5}}, -\frac {3 \, {\left (16 \, {\left (8 \, c^{4} d - 4 \, b c^{3} e + {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} f\right )} g^{2} - 16 \, {\left (8 \, b c^{3} d - 2 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} e + {\left (5 \, b^{3} c - 12 \, a b c^{2}\right )} f\right )} g h + {\left (16 \, {\left (3 \, b^{2} c^{2} - 4 \, a c^{3}\right )} d - 8 \, {\left (5 \, b^{3} c - 12 \, a b c^{2}\right )} e + {\left (35 \, b^{4} - 120 \, a b^{2} c + 48 \, a^{2} c^{2}\right )} f\right )} h^{2}\right )} \sqrt {-c} \arctan \left (\frac {\sqrt {c x^{2} + b x + a} {\left (2 \, c x + b\right )} \sqrt {-c}}{2 \, {\left (c^{2} x^{2} + b c x + a c\right )}}\right ) - 2 \, {\left (48 \, c^{4} f h^{2} x^{3} + 48 \, {\left (4 \, c^{4} e - 3 \, b c^{3} f\right )} g^{2} + 16 \, {\left (24 \, c^{4} d - 18 \, b c^{3} e + {\left (15 \, b^{2} c^{2} - 16 \, a c^{3}\right )} f\right )} g h - {\left (144 \, b c^{3} d - 8 \, {\left (15 \, b^{2} c^{2} - 16 \, a c^{3}\right )} e + 5 \, {\left (21 \, b^{3} c - 44 \, a b c^{2}\right )} f\right )} h^{2} + 8 \, {\left (16 \, c^{4} f g h + {\left (8 \, c^{4} e - 7 \, b c^{3} f\right )} h^{2}\right )} x^{2} + 2 \, {\left (48 \, c^{4} f g^{2} + 16 \, {\left (6 \, c^{4} e - 5 \, b c^{3} f\right )} g h + {\left (48 \, c^{4} d - 40 \, b c^{3} e + {\left (35 \, b^{2} c^{2} - 36 \, a c^{3}\right )} f\right )} h^{2}\right )} x\right )} \sqrt {c x^{2} + b x + a}}{384 \, c^{5}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.30, size = 457, normalized size = 1.09 \[ \frac {1}{192} \, \sqrt {c x^{2} + b x + a} {\left (2 \, {\left (4 \, {\left (\frac {6 \, f h^{2} x}{c} + \frac {16 \, c^{3} f g h - 7 \, b c^{2} f h^{2} + 8 \, c^{3} h^{2} e}{c^{4}}\right )} x + \frac {48 \, c^{3} f g^{2} - 80 \, b c^{2} f g h + 48 \, c^{3} d h^{2} + 35 \, b^{2} c f h^{2} - 36 \, a c^{2} f h^{2} + 96 \, c^{3} g h e - 40 \, b c^{2} h^{2} e}{c^{4}}\right )} x - \frac {144 \, b c^{2} f g^{2} - 384 \, c^{3} d g h - 240 \, b^{2} c f g h + 256 \, a c^{2} f g h + 144 \, b c^{2} d h^{2} + 105 \, b^{3} f h^{2} - 220 \, a b c f h^{2} - 192 \, c^{3} g^{2} e + 288 \, b c^{2} g h e - 120 \, b^{2} c h^{2} e + 128 \, a c^{2} h^{2} e}{c^{4}}\right )} - \frac {{\left (128 \, c^{4} d g^{2} + 48 \, b^{2} c^{2} f g^{2} - 64 \, a c^{3} f g^{2} - 128 \, b c^{3} d g h - 80 \, b^{3} c f g h + 192 \, a b c^{2} f g h + 48 \, b^{2} c^{2} d h^{2} - 64 \, a c^{3} d h^{2} + 35 \, b^{4} f h^{2} - 120 \, a b^{2} c f h^{2} + 48 \, a^{2} c^{2} f h^{2} - 64 \, b c^{3} g^{2} e + 96 \, b^{2} c^{2} g h e - 128 \, a c^{3} g h e - 40 \, b^{3} c h^{2} e + 96 \, a b c^{2} h^{2} e\right )} \log \left ({\left | -2 \, {\left (\sqrt {c} x - \sqrt {c x^{2} + b x + a}\right )} \sqrt {c} - b \right |}\right )}{128 \, c^{\frac {9}{2}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.01, size = 1069, normalized size = 2.55 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {{\left (g+h\,x\right )}^2\,\left (f\,x^2+e\,x+d\right )}{\sqrt {c\,x^2+b\,x+a}} \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (g + h x\right )^{2} \left (d + e x + f x^{2}\right )}{\sqrt {a + b x + c x^{2}}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________